import java.io.ObjectInputStream.GetField;
import java.util.Scanner;
public class FlightTester {
	
	
	
	public static void main (String ARGC[])
	{
		
		Scanner scan = new Scanner (System.in);
		
		System.out.println("Enter Date1 (dd mm yyyy):");
		Date d1 = new Date( scan.nextInt() , scan.nextInt() ,scan.nextInt());

		System.out.println("Enter Date2 (dd mm yyyy):");
		Date d2 = new Date( scan.nextInt() , scan.nextInt() ,scan.nextInt());
		
		
		Flight f1 = new Flight(100,d1,"TLV","London");
		Flight f2 = new Flight(100,d2,"TLV","Rome");
		Flight f3 = new Flight(f1);
		
		if (f1.isEquals(f2))
			System.out.println("Fligh1 Is Equal to Flight2");
		else
			System.out.println("Fligh1 Is NOT Equal to Flight2");
			
		
		if (f1.isEquals(f3))
			System.out.println("Fligh1 Is Equal to Flight3");
		else
			System.out.println("Fligh1 Is NOT Equal to Flight3");
		
		System.out.println("Flight1: "+f1);
		System.out.println("Flight2: "+f2);
		System.out.println("Flight3: "+f3);
		
		//aliasing !!!!
		d1.setDay(2);
		f1.setDestination("WASH");
		
		if (f1.isEquals(f3))
			System.out.println("Fligh1 Is Equal to Flight3 ");
		else
			System.out.println("Fligh1 Is NOT Equal to Flight3 ");

		
		System.out.println("Flight1: "+f1);
		System.out.println("Flight2: "+f2);
		System.out.println("Flight3: "+f3);
		
		f1.setFlightDate(d1);
		
		if (f1.isEquals(f3))
			System.out.println("Fligh1 Is Equal to Flight3");
		else
			System.out.println("Fligh1 Is NOT Equal to Flight3");
		
		
		Date tempDate  = f1.getFlightDate();
		
		int tempMonth = tempDate.getMonth();
		int tempYear = tempDate.getYear();
		
		
		//End of the Year we should restart month count , and increment year
		if(tempMonth==12)
		{
			tempMonth=1;
			tempYear++;
			tempDate.setYear(tempYear);
		}
		else
		{
			tempMonth++;
		}
		
		tempDate.setMonth(tempMonth);
		
		
		
		f1.setFlightDate(tempDate);
		
		f1.incrementMonth();
		
		f1.setTotalSeats(150);
		System.out.println("Flight1: "+f1);
		System.out.println("Flight2: "+f2);
		System.out.println("Flight3: "+f3);
		
		
		//Reserve 5 Seats in Flight1
		if (f1.bookFlight(500))
		{
			System.out.print("Booking Succedded, Remaining Seats in the Flight:" + f1.placesLeft() );
			
			
		}
		else
		{
			System.out.print("Booking Failed !!" );
			
		}
		
		System.out.println("This flight is "+ (f1.isFull()?"full":"not full") );
		
		//f1.setFlightDate( f1.getFlightDate().setMonth(4)) );
		

		
		

		
		
		
	}
	
	

}
